package com.tcoiss.webservice.controller.webapi;

import com.tcoiss.common.core.domain.R;
import com.tcoiss.webservice.config.WebSocketConfig;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * IMS接口
 * @author bisong
 */
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/ims")
public class IMSServiceController {
    
    @Autowired
    WebSocketConfig socketConfig;
    
    @PostMapping("/push")
    public R sendWebSocket(@RequestBody String massage) {
        socketConfig.sendMsg(socketConfig.webSocketClient(),massage);
        return R.ok();
    }
}
